package com.pay.controller;

import org.springframework.stereotype.Component;

import java.lang.reflect.Field;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 访问路径
 * @author Evan
 * @date 2017/10/26
 */
@Component
public class Routes {
    private Map<String, String> paths = new ConcurrentHashMap<>();


    public Routes() throws IllegalAccessException {
        Field[] fields = this.getClass().getFields();
        for (int i = 0; i < fields.length; i++) {
            Field field = fields[i];
            paths.put(field.getName(), (String) field.get(this));
        }
    }

    public String path(String key) {
        return paths.get(key);
    }
    public static final String HOME = "/";
    public static final String ERROR = "/errorTest";
    public static final String INDEX = "/index";
    public static final String SYSTEM_ERROR = "/systemError";
    public static final String LOGIN = "/login";
    public static final String LOGOUT = "/logout";
    public static final String AUTH = "/auth";

    /**
     * 银行信息
     */
    public static final String GET_BANK_CODE = "/getBankCode";
    public static final String GET_BANK_LIST = "/getBankList";

    /**
     * 方位，省市信息
     */
    public static final String GET_PROVINCE_LIST = "/getProvinceList";
    public static final String GET_CITY_LIST_BY_PROVINCE_CODE = "/getCityListByProvinceCode";


}
